import {get} from '../get'
import {request} from '../request'

export const getStratum = (pageNum, pageSize, searchModel) => {
  return get.get(`/stratum/${pageNum}/${pageSize}`, {
    params: searchModel
  })
}

export const getDictChild = (parentName) => {
  return get.get('/stratum/dict/child', {
    params: {
      name: parentName
    }
  })
}

export const deleteStratum = (id) => {
  return request.delete(`/stratum/${id}`)
}

export const updateStratum = (id, updateStratum) => {
  return request.put(`/stratum/${id}`, updateStratum)
}

export const getTableHead = (moduleName) => {
  return get.get(`/stratum/dataBrowser/tableHead/${moduleName}`)
}

export const getTableData = (moduleName,pageNum, pageSize, searchModel) => {
  return get.get(`/stratum/dataBrowser/${moduleName}/${pageNum}/${pageSize}`, {
    params: searchModel
  })
}
